<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <h1>Date里面的日期{{data_date}}</h1>
        <h1>{{message}}</h1>
        <h1>{{new_date()}}</h1>
        <!--  -->
        <hr>
        <h1>计算属性</h1>
        <h1>反转：{{reverseMessage}}</h1>
        <h1>日期:{{computed_date}}</h1>
        <button @click="changeMessage">改变消息</button>
    </div>
    <script src="vue.js"></script>
    <script>
        let vm = new Vue({
            el: "#app",
            data: {
                data_date: Date.now(),
                message: "Hello",
                new_date: function () {
                    return Date.now();
                }

            },
            computed: {
                reverseMessage: function () {
                    return this.message.split("").reverse().join("");
                },
                computed_date: function () {
                    return Date.now();
                }
            },
            methods: {
                changeMessage: function () {
                    this.message = "no hello"
                },

            },
        })
    </script>
</body>

</html>